import config from "@/config";
import http from "@/utils/request";

export default {
	add: {
		url: `${config.API_URL}/question/add`,
		name: "新增",
		post: async function (data) {
			return await http.post(this.url, data);
		},
	},
	update: {
		url: `${config.API_URL}/question/update`,
		name: "编辑",
		post: async function (data) {
			return await http.post(this.url, data);
		},
	},
	remove: {
		url: `${config.API_URL}/question/remove`,
		name: "删除",
		post: async function (data) {
			return await http.post(this.url, data);
		},
	},
	disable: {
		url: `${config.API_URL}/question/disable`,
		name: "禁用",
		post: async function (data) {
			return await http.post(this.url, data);
		},
	},
	page: {
		url: `${config.API_URL}/question/list/page`,
		name: "分页列表",
		get: async function (data) {
			return await http.post(this.url, data);
		},
	},
	detail: {
		url: `${config.API_URL}/question/detail`,
		name: "详情",
		get: async function (data) {
			return await http.get(this.url + "/" + data);
		},
	},
	simpleDetail: {
		url: `${config.API_URL}/question/detail/simple`,
		name: "基础详情",
		get: async function (data) {
			return await http.get(this.url + "/" + data);
		},
	},

	languageSet: {
		url: `${config.API_URL}/question/update/langugae`,
		name: "设置语言",
		post: async function (data) {
			return await http.post(this.url, data);
		},
	},

	languageRemove: {
		url: `${config.API_URL}/question/remove/language`,
		name: "删除语言",
		post: async function (data) {
			return await http.post(this.url, data);
		},
	},
	availableList: {
		url: `${config.API_URL}/question/list/available`,
		name: "获取试题的所有可用列表",
		get: async function () {
			return await http.get(this.url);
		},
	},
};
